package com.szwistar.common.comm.blocktrans;

import org.apache.mina.core.buffer.IoBuffer;

public interface BlockTransPayload {
	/**
	 * 返回自己的净荷类型ID
	 */
	short typeId();

	/**
	 * 编码
	 * @param out
	 * @throws Exception
	 */
	void encode(IoBuffer out) throws Exception;

	/**
	 * 解码
	 * @param in
	 * @throws Exception
	 */
	void decode(IoBuffer in, int length) throws Exception;
}
